import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login';
import Home from '../views/home/Home';
import Organize from "../views/organize/Organize";
import Resume from "../views/personInfo/Resume";
import SearchResult from "../views/SearchResult";
import Advance from "../views/advance/Advance";
import Category from "../views/Category";
import Analysis from "../views/analysis/Analysis";

Vue.use(VueRouter)

const redirect = process.env.NODE_ENV === 'production' ? [] : [{
    path: '/',
    redirect: '/login'
}];

const routes = [
    ...redirect,
    {
        path: '/login',
        name: 'Login',
        component: Login
    },
    {
        path: '/home',
        name: 'Home',
        component: Home
    },
    {
        path: '/organize',
        name: 'Organize',
        component: Organize
    },
    {
        path: '/searchResult',
        name: 'SearchResult',
        component: SearchResult
    },
    {
        path: '/advance',
        name: 'Advance',
        component: Advance
    },
    {
        path: '/category',
        name: 'Category',
        component: Category
    },
    {
        path: '/resume',
        name: 'Resume',
        component: Resume
    },
    {
        path: '/analysis',
        name: 'Analysis',
        component: Analysis
    }
]

const router = new VueRouter({
    // mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
